function getPromise() {
  console.log('111111')
  return new Promise((resolve, reject) => {
    // 异步请求处理
    console.log('222222')
    if (true) {
      console.log('333333')
      resolve({ resolve: true })
    } else {
      console.log('444444444')
      reject('reject')
    }
  })
}

async function getData() {
  let str
  console.log('555555')
  let data = await getPromise()
  console.log('666666', data)
  str = data
  console.log('7777777')
  return str
}
async function native() {
  console.log('native88888888')
  let num = await getData()
  console.log('native99999num', num)
  return num
}

async function getSetting() {
  console.log('aaaaaaaaa')
  let num = await native()
  console.log('bbbbbbb', num)
}

// getSetting()

// 执行顺序
// aaaaaaaaa
// native88888888
// 555555
// 111111
// 222222
// 333333
// 666666 { resolve: true }
// 7777777
// native99999num { resolve: true }
// bbbbbbb { resolve: true }

// console.log('start')
// const promise = new Promise((resolve, reject) => {
//   setTimeout(() => {
//     resolve('异步操作完成')
//   }, 1000)
// })
// promise.then(res => { console.log(res) })
// console.log('end')

// start->end->(1s后)异步操作完成

// console.log('开始');
// async function asyncOperation() {
//   await new Promise(resolve => setTimeout(resolve, 1000));
//   console.log('异步操作完成');
// }
// asyncOperation();
// console.log('结束');

// console.log('开始')
// async function fun() {
//   console.log('执行函数')
//   return 'callback'
// }

// fun().then(res => { console.log(res) })
// console.log('结束')

let arr = [1, 2, 3]
const fun = () => {
  console.log('hello world!')
}
class Perple {

}
console.log(typeof Perple)

class Mydemo {
  constructor(props) {
    super(props)
    this.a = props.a
  }
}